package cn.zdsoft.configuration.core.exceptions;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 应用异常
 * Created by wangdongdong on 2018/5/14.
 */
public class ConfigurationException extends Exception {

    private static final Logger logger = LoggerFactory.getLogger(ConfigurationException.class);

    public ConfigurationException() {
        super();
    }

    public ConfigurationException(String message) {
        super(message);
    }

    public ConfigurationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ConfigurationException(Throwable cause) {
        super(cause);
    }

    public static ConfigurationException createExceptin(String message) {
        logger.error(message);
        return new ConfigurationException(message);
    }

    public static ConfigurationException createExceptin(String message, Throwable cause) {
        logger.error(message, cause);
        return new ConfigurationException(message);
    }

    public static ConfigurationException createExceptin(Throwable cause) {
        logger.error("", cause);
        return new ConfigurationException(cause);
    }
}
